package configs

import capi "github.com/hashicorp/consul/api"

type ConsulConfig struct {
	consul *capi.Client
}

func (c *ConsulConfig) Consul(address string) ConsulConfig {

	cfg := capi.DefaultConfig()

	cfg.Address = address

	client, err := capi.NewClient(cfg)
	if err != nil {
		panic(err)
	}
	return ConsulConfig{
		consul: client,
	}
}

type ConsulMsg struct {
	Name    string
	Port    int
	Tage    []string
	Address string
}
